package org.acme.quickstart.service;

import io.smallrye.mutiny.Uni;
import javax.enterprise.context.ApplicationScoped;

/**
 * Description:  .<br>
 * <p>Created Time: 2020/10/26 12:31 </p>
 *
 * @author <a href="mail to: mengxiangyuancc@gmail.com" rel="nofollow">孟祥元</a>
 */
@ApplicationScoped
public class ReactiveGreetingService {

    public Uni<String> greeting(String name) {
        return Uni.createFrom().item(name)
            .onItem().transform(n -> String.format("hello %s", name));
    }
}
